/**
 * 功能描述 卡片
 */

define(function(require, exports, module) {
	var Form = require("form");
	var enmu = require("enums");
	var moment = require("moment");
	var Dialog = require("dialog");
	var store = require("store");
	var activeUser = store.get("user");
	
	
	var instance = {
		initComponent : function(params, widget) {
			var addRoomForm = new Form({
				parentNode : ".J-addRoomForm",
				show : false,
				model : {
					id : "addRoomForm",
					saveaction: function() {
						widget.handler.saveRoomEvent(widget);
                    },
                    saveText: "保存",
                    cancelaction: function() {
                    	var data = widget.get("tempGridRowData");
                    	widget.toRoomForm(data);
                    },
                    cancelText: "取消",
					items : [{
						name:"pkRoom",
						type:"hidden"
					},{
                   	 	name : "version",
                   	 	type : "hidden",
                   	 	defaultValue : "0",
					},{
						name:"pkGroupReserve",
						type:"hidden"
					},{
						label : "楼宇",
						name:"orgBuilding",
						type:"select",
						url: "api/orgbuilding/query",
						lazy:true,
						keyField: "pkOrgBuilding",
						valueField: "name",
						validate: ["required"]
					},{
						label : "房型",
						name:"roomType",
						lazy:true,
						keyField: "pkRoomType",
        	            valueField: "name",
        	            url:"api/groupreserve/queryroomtype",
						type:"select",
						validate: ["required"]
					},{
						label : "预订房间",
						name:"room",
						type:"select",
						url: "api/roomregister/queryroomstatus",
						lazy:true,
						keyField: "pkRoom",
						valueField: "code",
						validate: ["required"]
					}]
				}
			});
			widget.set("addRoomForm", addRoomForm);
		}
	};
	module.exports = instance;
});
